<template>
    <div>
        <!-- 轮播图 -->
            <swiper class="lunbo" auto :duration='1000' :min-moving-distance="300" :show-dots="true" :loop="true">
            <swiper-item class="item" v-for="(text , index) in dataList" :key="index" >
          <img v-if="text.image != null" :src="text.image.url" class="im">
        </swiper-item>
        </swiper>
        
    <main>
          <homeMain></homeMain>
    </main>
    </div>
</template>

<script>
import homeMain from './homeMain'

import { Swiper,SwiperItem } from 'vux'
export default {
data() {
    return {
        //轮播图
        dataList:[],
       
    }
 },
 components:{
    SwiperItem,
    Swiper,
    homeMain
 },
 methods: {
     // 轮播图
     getHomeInfo: function() {
          var _this = this
          this.$http.get('/weiju/api/v6/op/sentences/daily?page=1&per_page=30&token=edd704412ee957bc1594c902f172b9c8&timestamp=1545183685&app_key=2a438661-92c0-4a2d-b32e-3fd0c47a0a3c&platform=android&channel=ch_xiaomi&version_code=484&version=v3.7.2&system_version=27&device_type=MI%208&device_id=d317466bdcb13faa&signature=5f5672d179a08108de7a0b697257ae98').then(function(data) {
            //   console.log(data)
              _this.dataList = data.body.data
            //  console.log(_this.dataList)
          })
     },
     
 },
 mounted() {
    //  轮播图
     this.getHomeInfo()
   
     
 },
}
</script>

<style scoped>
.lunbo {
  width: 100vw;
  color: black;
    height: 43vw;
}
.item{
    width: 100vw;
}
.im{
  width: 100vw;
  height: 40vw;
  box-sizing: border-box;
}
</style>